package com.pp.service.impl;

import com.pp.entity.User;
import com.pp.mapper.LoginMapper;
import com.pp.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by lanou on 18/2/1.
 */
@Service
public class LoginServiceImpl implements LoginService{
    @Resource
    private LoginMapper loginMapper;
    public User login(User user) {
        User user1 =loginMapper.login(user);
        if(user1!=null){
            return user1;
        }
        return null;
    }

    public void register(User user) {
        loginMapper.register(user);
    }

    public boolean isRigister(User user) {
        int count = loginMapper.isRegister(user);
        if(count>0){
            return false;
        }
        return true;
    }

    public String getUserAbout(String userName) {
        String about = loginMapper.about(userName);

        return about;
    }
}
